package routes

import (
	"game-server/app/controllers/app"

	"github.com/gin-gonic/gin"
)

// SetCategoryGroupRoutes 定义 Category 分组路由
func SetArticleGroupRoutes(router *gin.RouterGroup) {
	frontRouter := router.Group("/admin")
	{
		frontRouter.POST("/article/list", app.ArticleList)
		// 详情
		frontRouter.POST("/article/detail", app.ArticleDetail)
		//随机获取文章
		frontRouter.POST("/article/random", app.ArticleRandom)
	}

	// authRouter := router.Group("/admin").Use(middleware.JWTAuth(services.AdminGuardName))
	authRouter := router.Group("/admin")
	{
		authRouter.POST("/article/add", app.ArticleAdd)
		authRouter.POST("/article/update", app.ArticleUpdate)
		authRouter.POST("/article/delete", app.ArticleDelete)
		//新增评论
		authRouter.POST("/article/comment/add", app.ArticleCommentAdd)
		//修改评论
		authRouter.POST("/article/comment/update", app.ArticleCommentUpdate)
		//删除评论
		authRouter.POST("/article/comment/delete", app.ArticleCommentDelete)
	}
}
